#include<bits/stdc++.h>
using namespace std;
const int N = 100000;
long long val[N];
int main(){
	int n;
	cin>>n;
	val[0] = 1;
	for(int i = 1;i<=n;i++){
		for(int j = 0;j < i;j++){
			val[i] = max(val[i],val[j]/__gcd(val[j],(long long)i - j)*(i - j));
		}
	}
	cout<<val[n]<<'\n';
}